package com.payment.ktb.constants;

/**
 * Created by admin on 2017/12/5.
 */

public enum  ConstantsProfitType {


    T0("T0", "快捷收款"),
    T1("T1", "普通收款"),
    S0("S0", "系统维护费"),
    S1("S1", "提现费"),
    ORDER("O", "订单分润"),
    SETTLE("S", "结算分润"),
    CHARGE("C", "提现分润"),
    CARDAUTH("JQ", "鉴权分润"),
    CERTAUTH("SM", "实名分润"),
    REWARD("HD", "活动奖励"),
    VIP("VIP", "会员分润"),
    ORG("ORG", "代理商升级"),
    PREPAY("PRE", "预消费分润");


    private final String code;
    private final String name;


    private ConstantsProfitType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getType (String code) {

        for (ConstantsProfitType constantsProfitType:ConstantsProfitType.values()) {
            if (constantsProfitType.getCode().equals(code)) {
                return constantsProfitType.getName();
            }
        }
        return "未知";
    }

}
